import jwt

from OAsystem import settings


def check_userjwt(token):
    try:
        payload = jwt.decode(token, settings.SECRET_KEY, algorithms="HS256")
    except Exception as e:
        print("校验token报错: %s" % e)
        payload = None
    return payload